{include file="common/head"}
<head>
<title>学车须知</title>
<link    rel="stylesheet"    href="https://cdnjs.cloudflare.com/ajax/libs/jodit/3.24.2/jodit.es2018.min.css"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jodit/3.24.2/jodit.es2018.min.js"></script>    

<style>
  .box{border: 0px solid #ccc;text-align: left;max-width: 800px;padding:10px 20px;}
</style>
</head>
<body style="">
    <div class=" p-3 my-3 " style="max-width: 800px;"  >
    <h2>
      <c class="btn btn-info">学车须知</c>
      <c class="btn btn-secondary">汽车知识</c>
      <c class="btn btn-success">报名流程</c>  
    </h2>
    <h2></h2>
    <form method="post" action="/index.php/index/xcxz" enctype="multipart/form-data">
      <input type="hidden" name="id" value="{$data.id}" />
      <input type="hidden" name="post_edit" value="1" />

      <div class="mb-3">
        <label for="title" class="form-label">标题：</label>
        <input type="text" class="form-control" id="title" name="title" placeholder="标题"  value="{$data.title}" />
      </div>

      <div class="mb-3 xcxz">
        <label for="xcxz" class="form-label">内容：</label>
        <textarea class="form-control" id="xcxz" name="xcxz" placeholder="内容"  >{$data.xcxz}</textarea>
      </div>
      <div class="mb-3 qczs" style="display: none;">
        <label for="qczs" class="form-label">内容：</label>
        <textarea class="form-control" id="qczs" name="qczs" placeholder="内容"  >{$data.qczs}</textarea>
      </div>
      <div class="mb-3 bmlc" style="display: none;">
        <label for="bmlc" class="form-label">内容：</label>
        <textarea class="form-control" id="bmlc" name="bmlc" placeholder="内容"  >{$data.bmlc}</textarea>
      </div>      


      <button  type="button" class="btn btn-primary" onclick="doSave()">保存</button>

    </form>
    </div>


<script type="text/javascript">

    var editor = Jodit.make('#xcxz',{
      toolbarButtonSize: 'small',
      //textIcons: true
    });
    var editor2 = Jodit.make('#qczs',{
      toolbarButtonSize: 'small',
      //textIcons: true
    });
    var editor3 = Jodit.make('#bmlc',{
      toolbarButtonSize: 'small',
      //textIcons: true
    });

    //editor.value = ''; 

    function doSave(){
      if(!$("#title").val() || !$("#xcxz").val()) {
        layer.msg("无效的名称,内容!");
        return 0;
      }    
      $('form').submit();
    }


    $(function(){
      $(".btn").on('click',function(){
        $(this).siblings().addClass('btn');
        $(this).removeClass('btn');
      })

      $(".btn-info").on('click',function(){
        $("#title").val('学车须知')
        $(".xcxz").show();
        $(".qczs").hide();
        $(".bmlc").hide();

      })

      $(".btn-secondary").on('click',function(){
        $("#title").val('汽车知识')
        $(".xcxz").hide();
        $(".qczs").show();
        $(".bmlc").hide();

      })
      $(".btn-success").on('click',function(){
        $("#title").val('报名流程')
        $(".xcxz").hide();
        $(".qczs").hide();
        $(".bmlc").show();

      })

    })

</script>


</body>
</html>
